import jsonp from 'jsonp';

export default function request(url, params={}) {
  let promise = new Promise((resolve ,reject) => {
    jsonp(url, params, (err, data) => {
      if (!err) {
        console.log('request------->', data)
        resolve(data);
      } else {
        reject('Error:', err)
      }
    })
  });

  return promise;
}
